package cn.bnuz.edu.liyang.wait_eat_what;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DataBase extends SQLiteOpenHelper {
    private  static  final String CREATE_Food = "create table Thing(id integer primary key autoincrement,name text,"+
            "fromm text,img_url text,adress text,price number,stars number)";
    private Context mContext;
    public DataBase(Context context,String name,SQLiteDatabase.CursorFactory factory,int version){
        super(context,name,factory,version);
        mContext = context;
    }
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(CREATE_Food);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
        sqLiteDatabase.execSQL("drop table if exists Thing");
        onCreate(sqLiteDatabase);
    }
}
